/*
 * set of rules that define menu bar
 */

@set menu-bar {

  :root /*top level menu*/
  {
    font: system; font-rendering-mode:classic;
    behavior:menu-bar;
    flow: horizontal;
    background: var(base95-color);
    color:var(base95-text-color); 
    margin:0;
    padding:0;
  }

  :root > li /* menu item in menu bar */ 
  {  
    padding:2px 8px;
    margin:0;
    white-space:nowrap;
    width:max-intrinsic;
    display:block;
    flow:horizontal;
  }

  :root > li:current /* current menu item in menu bar */ 
  {  
    background-color:highlight; color:highlighttext; 
  }

  button[type="menu"]
  {
    behavior:button popup-menu; 
  }

  button[type="menu"]:owns-popup /* button when popup is shown */
  {
  	background-image:url(theme:button-pressed); /* ?? */  
  }

  menu  /* popup menu */
  {
    font: system; font-rendering-mode:classic;
    behavior:menu; /*is a menu*/
    flow: vertical;
    display:none; 
    margin:0;  
    padding:1px;
    max-width:max-intrinsic;
    /*min-width: max-intrinsic;*/
    border:1px solid threedshadow;
    background-color: window;
    color:windowtext;
    margin:0 1px; /* to offset it from parent li */    
  }

  menu menu /* secondary popup menu */
  {
    max-width: max-intrinsic;
  }

  /* menu item in popup menus */
  menu li
  {  
    width:*;
    flow:horizontal;
    padding-left:24px; /* room for icon */
    padding-right:12px; /* room for the arrow */
    padding-top:4px; 
    padding-bottom:4px; 
    foreground-repeat: no-repeat;
    foreground-position: 2px 50%;
    color:windowtext;
  }

  menu li:rtl 
  {  
    width:*;
    padding-right:24px; /* room for icon */
    padding-left:12px; /* room for the arrow */
    foreground-repeat: no-repeat;
    foreground-position-right: 2px;
    foreground-position-top: 50%;
    text-align:right;
    color:windowtext;
  }


  menu li:disabled { color:graytext; foreground-image: none; }

  /* accesskey label (span) */
  menu li span.accesskey
  {
    display:block;
    width:max-intrinsic;
    white-space:nowrap;
    margin-left:*; /* spring to attach it to the right */
    padding-left:1em;
    color:threedshadow;
  }


  menu li:current span.accesskey
  {
    color:#FFD700;
  }


  /* menu with single <menu> inside - submenu */
  menu li:has-child-of-type(menu)
  {
    foreground-image:url(stock:arrow-right); /* that arrow */
    foreground-repeat: no-repeat;
    foreground-position: 100% 50%;
  }

  menu li:has-child-of-type(menu):rtl
  {
    foreground-image:url(stock:arrow-left); /* that arrow */
    foreground-repeat: no-repeat;
    foreground-position: 0% 50%;
  }


  /* current menu item */
  menu li:hover:owns-popup,
  menu li:current
  { 
    background-color:highlight; color:highlighttext; 
  }

  /* menu separator */
  menu hr 
  {
    margin:2px; 
  }


  /* radio menu item */
  menu li[type="radio"]
  { 
  	behavior:radio; 
  	foreground-repeat:no-repeat; 
  	foreground-position:3px 50%;
  	foreground-image:url(stock:circle);
    foreground-size: 7px;
    stroke: var(accent);
  }
  menu li[type="radio"]:checked
  { 
  	foreground-image:url(stock:disk);  
    fill: var(accent);
  }

  /* checkmark menu item */
  menu li[type="check"]
  { 
  	behavior:check; 
  	foreground-repeat:no-repeat; 
  	foreground-position:left 7px top 50%;
    foreground-size: 9px;
  }
  menu li[type="check"]:checked
  { 
    foreground-image:url(stock:checkmark);
    fill: var(accent);
  }
  menu li[type="check"]:disabled
  { 
  	fill:grey;  
  }

}